//
//  LXLeftCell.m
//  灵秀
//
//  Created by 李田 on 17/3/18.
//  Copyright © 2017年 tianyao. All rights reserved.
//

#import "LXLeftCell.h"

@implementation LXLeftCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    return self;
}

#pragma mark - 1.0 搭建界面
- (void)setupUI {
    
    // 1. 背景色
    self.contentView.backgroundColor = [UIColor cz_colorWithHex:0xf8f8f8];
    
    // 2.字体的大小,颜色,行数
    self.textLabel.font = [UIFont systemFontOfSize:13];
    self.textLabel.textColor = [UIColor cz_colorWithHex:0x464646];
    self.textLabel.numberOfLines = 2;
    
    // 3.设置选中的View
    UIView *selectedView = [[UIView alloc]init];
    selectedView.backgroundColor = [UIColor greenColor];
    self.selectedBackgroundView = selectedView;
    
    // 4.小黄条
    UIView *yellowLine = [[UIView alloc]init];
    yellowLine.backgroundColor = [UIColor cz_colorWithHex:0xffd900];
    [selectedView addSubview:yellowLine];
    
    
    // 5.分割线
    UIView *line = [[UIView alloc]init];
    line.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:line];
    
    //    MARK: 布局
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.right.bottom.equalTo(self.contentView);
        make.height.mas_equalTo(1/[UIScreen mainScreen].scale);
    }];
    
    [yellowLine mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.height.mas_equalTo(33);
        make.width.mas_equalTo(4);
        make.centerY.left.equalTo(selectedView);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
